#ifndef __IIC_H__
#define __IIC_H__

#include "stdint.h"
#include <freertos/FreeRTOS.h>
#include "freertos/event_groups.h"
#include <esp_log.h>
#include <arpa/inet.h>
#include "esp_wifi.h"
#include "driver/gpio.h"
#include "driver/i2c.h"


//I2C 
#define I2C_SCL_IO          GPIO_NUM_23       
#define I2C_SDA_IO          GPIO_NUM_18         

#define I2C_MASTER_NUM      I2C_NUM_1           //I2C_1
#define WRITE_BIT           I2C_MASTER_WRITE    //写:0
#define READ_BIT            I2C_MASTER_READ     //读:1
#define ACK_CHECK_EN        0x1                 //主机检查从机的ACK
#define ACK_CHECK_DIS       0x0                 //主机不检查从机的ACK
#define ACK_VAL             0x0                 //应答
#define NACK_VAL            0x1                 //不应答


void i2c_init(void);

#endif